CLS

SET NETWORKPATH=%~dp0

echo "Set Auto Update Permissions"
ATTRIB -R "%NETWORKPATH%AutoUpdate\App_Data\AutoUpdate\App_Offline.htm"
ATTRIB -R "%NETWORKPATH%AutoUpdate\App_Data\AutoUpdate\SET_PERMISSIONS.bat"

ICACLS "%NETWORKPATH%AutoUpdate\App_Data\AutoUpdate\App_Offline.htm" /grant:r "NETWORK SERVICE":M /Q
ICACLS "%NETWORKPATH%AutoUpdate\App_Data\AutoUpdate\SET_PERMISSIONS.bat" /grant:r "NETWORK SERVICE":M /Q

echo "Set Components Permissions"
ICACLS "%NETWORKPATH%Components" /grant:r "NETWORK SERVICE":(OI)(CI)R /Q

echo "Set Plugins Permissions"
ICACLS "%NETWORKPATH%CMS6\App_Data\Plugins" /grant:r "NETWORK SERVICE":(OI)(CI)M /Q

echo "Set Project Permissions"
ATTRIB -R "%NETWORKPATH%Project\Contents\Main\sitemap.xml"
ATTRIB -R "%NETWORKPATH%Project\Contents\Main\components.vxml"

ICACLS "%NETWORKPATH%Project\FileCenter" /grant:r "NETWORK SERVICE":(OI)(CI)M /Q
ICACLS "%NETWORKPATH%Project\Contents\Main\components.vxml" /grant:r "NETWORK SERVICE":M /Q
ICACLS "%NETWORKPATH%Project\Contents\Main\sitemap.xml" /grant:r "NETWORK SERVICE":M /Q

echo "Set Released_Project Permissions"
ATTRIB -R "%NETWORKPATH%Released_Project\Contents\Main\sitemap.xml"
ATTRIB -R "%NETWORKPATH%Released_Project\Contents\Main\components.vxml"

ICACLS "%NETWORKPATH%Released_Project\FileCenter" /grant:r "NETWORK SERVICE":(OI)(CI)M /Q
ICACLS "%NETWORKPATH%Released_Project\Contents\Main\components.vxml" /grant:r "NETWORK SERVICE":M /Q
ICACLS "%NETWORKPATH%Released_Project\Contents\Main\sitemap.xml" /grant:r "NETWORK SERVICE":M /Q

PAUSE